package com.kt.emall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Description: EmallMvcConfig
 * Created with IntelliJ IDEA.
 *
 * @author: KamTeng
 * Date: 2021/9/14
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    /**
     * 视图映射
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        /**
         *  @GetMapping("/login.html")
         *     public String loginPage() {
         *         return "login";
         *     }
         */
        //registry.addViewController("/login.html").setViewName("login");
        /**
         * @GetMapping("/reg.html")
         *     public String regPage() {
         *         return "reg";
         *     }
         */
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
